Page({
  data: {
    mheight: 10,
    catagory: [
      "便捷速食", "饼干糕点", "零食趣味", "奶香四溢", "饮水清爽", "生活无忧", "周边代购", "冰爽雪糕", "水果缤纷", "户外运动", "备战寒冬", "女神用品", "健身器材"
    ],
    shopList: [{
      img: "../../img/demoimage1.jpg",
      name: "香蕉",
      price: "1.1"
    }, {
      img: "../../img/demoimage2.jpg",
      name: "茄子",
      price: "1.2"
    }, {
      img: "../../img/demoimage3.jpg",
      name: "玉米",
      price: "1.3"
    }, {
      img: "../../img/demoimage1.jpg",
      name: "苹果",
      price: "1.4"
    }, {
      img: "../../img/demoimage2.jpg",
      name: "橘子",
      price: "1.5"
    }, {
      img: "../../img/demoimage3.jpg",
      name: "梨",
      price: "1.6"
    }, {
      img: "../../img/demoimage1.jpg",
      name: "花生",
      price: "1.7"
    }, {
      img: "../../img/demoimage2.jpg",
      name: "瓜子",
      price: "1.8"
    }, {
      img: "../../img/demoimage3.jpg",
      name: "矿泉水",
      price: "1.8"
    }]
  },

  onLoad: function(options) {
    // 页面初始化 options为页面跳转所带来的参数
    var a;
    var _self = this;
    wx.getSystemInfo({
      success: function(res) {
        _self.setData({
          mheight: res.windowHeight
        })
      }
    })

  },
  chicks: function(event) {
    console.log(event.target.dataset.name);
    wx.showActionSheet({
      itemList: ["别闹,还没有" + event.target.dataset.name],
      success: function(res) {
        if (!res.cancel) {
          console.log(res.tapIndex)
        }
      }
    })
  },
  onReady: function() {
    // 页面渲染完成
  },
  onShow: function() {
    // 页面显示
  },
  onHide: function() {
    // 页面隐藏
  },
  onUnload: function() {
    // 页面关闭
  },
  bindtap: function(event) {
    wx.navigateTo({
      url: "/pages/message/search/search"
    })
  },
})